package cn.itcast.bos.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.itcast.bos.domain.base.FixedArea;
import cn.itcast.bos.repository.FixedAreaRepository;
import cn.itcast.bos.service.FixedAreaService;

@Service
@Transactional
public class FixedAreaServiceImpl implements FixedAreaService{

	
	@Autowired
	private FixedAreaRepository fixedAreaRepository;

	/**
	 * 分页查询
	 * @param spec
	 * @param pageable
	 * @return
	 */
	@Override
	public Page<FixedArea> findByPage(Specification<FixedArea> spec,Pageable pageable){
		Page<FixedArea> page = fixedAreaRepository.findAll(spec, pageable);
		return page;
	}

	/**
	 * 新增定区
	 */
	@Override
	public void addFixedArea(FixedArea model) {
		fixedAreaRepository.save(model);
		
	}
}
